
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashSet;

public class e080 {
    public static void main(String[] args) {
        long sTime = System.currentTimeMillis();
        BigSquareRoot b = new BigSquareRoot();
        b.setScale(105);
        int sum = 0;
        String[] irrs = getIrrationals(100);
        for (String j : irrs) {
            String e = fix(b.get(new BigDecimal(j)).toString());
            for (int i = 0; i < e.length(); i++) {
                sum += Integer.parseInt(String.valueOf(e.charAt(i)));
            }
        }
        System.out.println(sum);
        long fTime = System.currentTimeMillis();
        System.out.println("Time: " + (fTime - sTime) + "ms");
    }

    public static String fix(String s) {
        StringBuilder b = new StringBuilder(s);
        b.deleteCharAt(1);
        b.delete(100, b.length());
        return b.toString();
    }

    public static String[] getIrrationals(int limit) {
        HashSet irrs = new HashSet();
        for (int j = 2; j <= limit; j++) {
            irrs.add(String.valueOf(j));
        }
        int i = 2;
        loop:
        while (i < limit) {
            int n = i*i;
            irrs.remove(String.valueOf(n));
            i++;
        }
        String[] irrsA = new String[irrs.size()];
        irrs.toArray(irrsA);
        Arrays.sort(irrsA);
        return irrsA;
    }
}